﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第三十六题
//BC38 变种水仙花
//https://www.nowcoder.com/practice/c178e3f5cc4641dfbc8b020ae79e2b71?tpId=107&tqId=33319&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include<stdio.h>

int main()
{
    int i, j;
    for (i = 10000; i < 99999; i++)
    {
        int sum = 0;
        for (int k = 0, j = 10; k < 4; k++, j *= 10)
        {
            sum += (i / j) * (i % j);
        }
        if (sum == i)
            printf("%d ", i);
    }
    return 0;
}
